<template>
  <div class="container mainCon">
    <topTitle :titleText="titleText"></topTitle>
    <el-tabs
      v-model="activeName"
      type="card"
      @tab-click="handleClick"
      class="commonTab"
    >
      <el-tab-pane label="预警风险" name="first">
        <risk-management-list
          type="ALERT"
          v-if="isShowFirst"
        ></risk-management-list>
      </el-tab-pane>
      <el-tab-pane label="警示风险" name="second">
        <risk-management-list
          type="WARN"
          v-if="isShowSecond"
        ></risk-management-list>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import RiskManagementList from './riskManagementList.vue'

export default {
  name: 'riskManagement',
  components: {
    RiskManagementList,
  },
  data() {
    return {
      titleText: '企业风险列表',
      activeName: 'first',
      isShowFirst: true,
      isShowSecond: false,
    }
  },
  methods: {
    //tabs栏切换
    handleClick(tab, event) {
      if (tab.name === 'first') {
        this.isShowFirst = true
      } else {
        this.isShowSecond = true
      }
    },
  },
}
</script>

<style scoped lang="less">
.mainCon {
  top: 130px;
  padding: 0;
}
</style>
